package com.WJY.service.impl;

import com.WJY.dao.DeptDao;
import com.WJY.pojo.Dept;
import com.WJY.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptServiceImpl implements DeptService {

    @Autowired
    private DeptDao deptDao;

    @Override
    public List<Dept> queryAllDept() {
        return deptDao.queryAllDept();
    }

    @Override
    public Dept queryDeptById(int id) {
        return deptDao.queryDeptById(id);
    }

    @Override
    public Boolean delDeptById(int id) {
        return deptDao.delDeptById(id) > 0;
    }

    @Override
    public Boolean addDept(Dept dept) {
        return deptDao.addDept(dept)>0;
    }

    @Override
    public Boolean updateDept(Dept dept) {
        return deptDao.updateDept(dept)>0;
    }
}
